class ErrorCode:
    SUCCESS = 200
    PARAM_ERROR = 400
    UNAUTHORIZED = 401
    FORBIDDEN = 403
    NOT_FOUND = 404
    SERVER_ERROR = 500
    INVALID_PARAMS = 600
    INVALID_OPERATION = 601

    # 用户相关错误码 (1000-1999)
    USER_NOT_FOUND = 1000
    PASSWORD_ERROR = 1001
    USER_ALREADY_EXISTS = 1002

    # 视频相关错误码 (2000-2999)
    VIDEO_NOT_FOUND = 2000
    VIDEO_UPLOAD_ERROR = 2001
    FILE_TYPE_ERROR = 2002

    # 食谱相关错误码 (3000-3999)
    RECIPE_NOT_FOUND = 3000
    RECIPE_CREATE_ERROR = 3001

    # 日历相关错误码 (4000-4999)
    CALENDAR_NOT_FOUND = 4000
    CALENDAR_CREATE_ERROR = 4001

    # 幂等性相关错误码 (5000-5999)
    DUPLICATE_REQUEST = 5000

    # OSS相关错误码 (6000-6999)
    OSS_ERROR = 6000

class ErrorMessage:
    MESSAGES = {
        ErrorCode.SUCCESS: "成功",
        ErrorCode.PARAM_ERROR: "参数错误",
        ErrorCode.UNAUTHORIZED: "未授权",
        ErrorCode.FORBIDDEN: "禁止访问",
        ErrorCode.NOT_FOUND: "资源不存在",
        ErrorCode.SERVER_ERROR: "服务器错误",
        
        ErrorCode.USER_NOT_FOUND: "用户不存在",
        ErrorCode.PASSWORD_ERROR: "密码错误",
        ErrorCode.USER_ALREADY_EXISTS: "用户已存在",
        
        ErrorCode.VIDEO_NOT_FOUND: "视频不存在",
        ErrorCode.VIDEO_UPLOAD_ERROR: "视频上传失败",
        ErrorCode.FILE_TYPE_ERROR: "文件类型错误",
        ErrorCode.RECIPE_NOT_FOUND: "食谱不存在",
        ErrorCode.RECIPE_CREATE_ERROR: "食谱创建失败",
        
        ErrorCode.CALENDAR_NOT_FOUND: "日历不存在",
        ErrorCode.CALENDAR_CREATE_ERROR: "日历创建失败",
        
        ErrorCode.DUPLICATE_REQUEST: "重复的请求，请稍后再试",
        ErrorCode.INVALID_PARAMS: "参数错误",
        ErrorCode.OSS_ERROR: "OSS操作失败",
    } 